﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace FondoDinamico.View
{
    public partial class ConfigPage : PhoneApplicationPage
    {
        public ConfigPage()
        {
            InitializeComponent();
        }

        private void ApplicationBarIconButton_Click(object sender, EventArgs e)
        {
            NavigationService.Navigate(new Uri("/View/MainPage.xaml?Pais=" + PaisTxt.Text + "&Ciudad=" + CiudadTxt.Text + "&Actualizar=" + ActualizarChk.IsChecked.ToString(), UriKind.Relative));
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            PaisTxt.Text = NavigationContext.QueryString["Pais"];
            CiudadTxt.Text = NavigationContext.QueryString["Ciudad"];
            ActualizarChk.IsChecked = Boolean.Parse(NavigationContext.QueryString["Actualizar"]);
               

        }

        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);
        //    ((FondoDinamico.ViewModel.DescargasPendientesViewModel)this.Resources["ViewModel"]).removeHandlers();

        }
    }
}